package com.example.transdemo.controller;

/*
 * @author zzr
 * @date: 2025/10/03  21:12
 * @description:
 */

import com.example.transdemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/user")
@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @Transactional
    @RequestMapping("/registry")
    public String registry(String name, String password) {
        // 用户注册
        userService.registryUser(name, password);
        return "注册成功";
    }
}
